using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SoundManager : MonoBehaviour
{
    /// <summary>
    /// 单例
    /// </summary>
    public static SoundManager Instance;
    
    /// <summary>
    /// 音频播放器
    /// </summary>
    private AudioSource _audioSource;
    
    /// <summary>
    /// 吃东西音效
    /// </summary>
    public AudioClip _eatSound;
    
    void Start()
    {
        Instance = this;
        // 获取
        _audioSource = GetComponent<AudioSource>();
    }

    /// <summary>
    /// 播放吃东西音效
    /// </summary>
    public void PlayEatSound()
    {
        _audioSource.clip = _eatSound;
        _audioSource.Play();
    }

}
